//
//  AngelScriptSyntaxHighlighter.h
//  Editor
//
//  Created by Jeppe Nielsen on 10/20/14.
//  Copyright (c) 2014 Jeppe Nielsen. All rights reserved.
//

#pragma once

#include <QtGui/QSyntaxHighlighter>
#include <QtGui/QTextCharFormat>


class QTextDocument;

class AngelScriptSyntaxHighlighter : public QSyntaxHighlighter
{
    Q_OBJECT

public:
    AngelScriptSyntaxHighlighter(QTextDocument *parent = 0);

protected:
    void highlightBlock(const QString &text);

private:
    struct HighlightingRule
    {
        QRegExp pattern;
        QTextCharFormat format;
    };
    QVector<HighlightingRule> highlightingRules;

    QRegExp commentStartExpression;
    QRegExp commentEndExpression;

    QTextCharFormat keywordFormat;
    QTextCharFormat classFormat;
    QTextCharFormat singleLineCommentFormat;
    QTextCharFormat multiLineCommentFormat;
    QTextCharFormat quotationFormat;
    QTextCharFormat functionFormat;
};



